#ifndef WXSSTYLEPROPERTY_H
#define WXSSTYLEPROPERTY_H

#include "../../properties/wxsproperties.h"
#include "../../wxscodinglang.h"
#include "../wxsstyle.h"


class wxsStyleProperty: public wxsProperty {
  public:
    wxsStyleProperty( const wxString& StyleName, const wxString& DataName, long  Offset, long  StyleSetPtrOffset,
                      bool  IsExtra = false, int Priority = 100 );
    virtual const wxString GetTypeName() { return _T( "Style" ); }
  protected:
    virtual void PGCreate( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Parent );
    virtual bool PGRead( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Id, long Index );
    virtual bool PGWrite( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Id, long Index );
    virtual bool XmlRead( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool XmlWrite( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool PropStreamRead( wxsPropertyContainer* Object, wxsPropertyStream* Stream );
    virtual bool PropStreamWrite( wxsPropertyContainer* Object, wxsPropertyStream* Stream );
  private:
    long Offset;
    long StyleSetPtrOffset;
    bool IsExtra;
};

#define WXS_STYLE(ClassName,VarName,PGName,DataName,StyleSetPtr) \
  { static wxsStyleProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),wxsOFFSET(ClassName,StyleSetPtr),false); \
    Property(_Property); }


#define WXS_STYLE_P(ClassName,VarName,PGName,DataName,StyleSetPtr,Priority) \
  { static wxsStyleProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),wxsOFFSET(ClassName,StyleSetPtr),false,Priority); \
    Property(_Property); }


#define WXS_EXSTYLE_P(ClassName,VarName,PGName,DataName,StyleSetPtr,Priority) \
  { static wxsStyleProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),wxsOFFSET(ClassName,StyleSetPtr),true,Priority); \
    Property(_Property); }



#endif
